#pragma once

#include <QWidget>


class CControlDlg : public QWidget
{
	Q_OBJECT
Q_SIGNALS:
	void signal_open_clicked();
	void signal_close_clicked();
public:
	enum ControlType :unsigned char {
		POWER_TYPE = 0,
		ALARM_LIGHT_TYPE,
		RAY_LIGHT_TYPE,
		VOLTAGE_24_TYPE,
		SHUTDOWN_TYPE,
		KB_RAY_TYPE,
		KB_RUN_TYPE,
		CONVEYOR_TYPE,
		RAY_1_TYPE,
		RAY_2_TYPE,
		VOLTAGE_12_TYPE,
		UNKNOW_TYPE = 0xFF
	};
	Q_ENUM(ControlType)
	CControlDlg(ControlType type,QWidget *parent = nullptr);
	~CControlDlg();
	void SetOpenBtnName(const QString&text);
	void SetCloseBtnName(const QString& text);
	void SetGroupTitle(const QString& title);
	inline ControlType GetControlType() { return m_control_type; }
protected:
	void OnInitDialog();
private:
	ControlType m_control_type;
};
